﻿using University;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace UniversityTest
{
    [TestClass]
    public class StudentTest
    {
        [TestMethod]
        public void FNTest()
        {
            string testName = "Todor";
            int testFN = 12345;
            Student target = new Student(testName, testFN);
            int expected = testFN;
            int actual = target.FN;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void NameTest()
        {
            string testName = "Todor";
            int testFN = 12345;
            Student target = new Student(testName, testFN);
            string expected = testName;
            string actual = target.Name;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentOutOfRangeException),"The FN must be between 10000 and 99999!")]
        public void FNOutOfRangeTest()
        {
            string testName = "Todor";
            int testFN = 2345;
            Student target = new Student(testName, testFN);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException), "Name can not be null!")]
        public void NameNullTest()
        {
            string testName = null;
            int testFN = 12345;
            Student target = new Student(testName, testFN);
        }
        
    }
}
